import request from '@/utils/request'

export function login(data) {
  return request({
    //url: '/vue-admin-template/user/login',
    url: '/api/oauth/login',
    method: 'post',
    // headers : {
    //   "Content-Type":'application/x-www-form-urlencoded; charset=UTF-8'
    // },
    params: data
  })
}

export function getUserBtnPermission(menuId){
  return request({
    url: '/api/user/menu/permission',
    method: 'get',
    params: {
      menuId: menuId
    }
  })
}

export function getUserManues() {
  return request({
    url: '/api/user/menu/list/tree',
    method: 'get'
  })
}

export function getInfo(token) {
  return request({
    url: '/api/user/userInfo',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/api/oauth/logout',
    method: 'post'
  })
}
